<?php


	namespace app\lib\event;

	use think\facade\Log;

	class BaseEvent
	{
		protected $actionEvent = 'doEvent';


		public function handle ($event) {
			try {
				if (method_exists($this, $this->actionEvent)) {
					$this->{$this->actionEvent}(...$event);
				} else {
					Log::error('方法：'.$this->actionEvent.'，不在类：'.__CLASS__.'中');
				}
			} catch (\Exception $exception) {
				Log::error('事件执行失败,错误原因：'.$exception->getMessage());
			}
		}
	}

